package com.chunfeng.service.ex;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 异常枚举
 *
 * @author by 春风能解释
 * <p>
 * 2022/9/7
 */
@AllArgsConstructor
@NoArgsConstructor
public enum ServiceExceptionEnum {
    INSERT_SOURCE_EXISTS(4001, "数据已存在!"),
    INSERT_SOURCE_ERROR(4002, "添加数据遇到错误!"),
    INSERT_SOURCE_NOT_EXISTS(4003, "请提供完整的信息!"),

    DELETE_SOURCE_NOT_EXISTS(5001, "待删除的数据不存在!"),
    DELETE_SOURCE_ERROR(5002, "删除数据时遇到错误!"),

    SELECT_SOURCE_NOT_EXISTS(6001, "没有查询到该数据!"),
    SELECT_SOURCE_ERROR(6002, "查询数据时遇到错误!"),

    UPDATE_SOURCE_ERROR(7001, "修改数据时遇到错误!"),
    UPDATE_SOURCE_NOT_EXISTS(7002, "待修改的数据不存在!"),

    TOKEN_NOT_EXISTS(8001, "非法登录!"),
    TOKEN_VERIFY_ERROR(8002, "非法登录!"),

    FILE_DELETE_ERROR(9001, "删除文件时遇到错误"),
    FILE_DELETE_NOT_EXISTS(9002, "待删除的文件不存在!"),

    FILE_UPLOAD_ERROR(10003, "待上传的文件为空!"),
    FILE_UPLOAD_EXISTS(10004, "文件重复!"),
    FILE_UPLOAD_NOT_EXISTS(10005, "请提供完整的文件上传信息!"),

    FILE_DOWNLOAD_ERROR(11001, "下载文件时出现问题!"),
    FILE_DOWNLOAD_NOT_EXISTS(11002, "下载的文件不存在!"),

    FILE_UPDATE_ERROR(12001, "修改文件时出现问题!"),
    FILE_UPDATE_NOT_EXISTS(12002, "待修改的文件不存在!"),

    REDIS_CLEAR_ERROR(13001, "清除缓存时遇到错误!"),

    LOG_INSERT_ERROR(14001, "添加日志时遇到错误!"),
    LOG_INSERT_EXISTS(14002, "日志重复!"),

    LOG_DELETE_ERROR(15001, "删除日志遇到错误!"),
    LOG_DELETE_NOT_EXISTS(15002, "日志不存在!"),

    LOG_SELECT_ERROR(16001, "查询日志时遇到错误!"),
    LOG_SELECT_NOT_EXISTS(16002, "日志为空!"),

    LOG_UPDATE_ERROR(17001, "修改日志时遇到错误!"),
    LOG_UPDATE_NOT_EXISTS(17002, "待修改的日志不存在!");

    /**
     * 状态码
     */
    private Integer status;

    /**
     * 消息
     */
    private String message;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
